package com.aifund.common.entity;

import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 跟单信息跟单交易员
 */
@Entity
@SQLDelete(sql = "update documentary_info set delete = 1 where id = ?")
@Where(clause = "is_del = 0")
@Data
@EntityListeners(AuditingEntityListener.class)
public class FollowOrderManTactics {
    @Id
    @GeneratedValue
    private Long id;

    /**
     * 交易员策略ID
     */
    private Long exchangeManTacticsId;

    /**
     * 跟单者ID
     */
    private Long userId;

    /**
     * 自动选币
     */
    private Boolean autoSelectCurrency;

    /**
     * 跟单类别 (1:模拟交易 2：真实交易）
     */
    private Integer followType;

    /**
     * 投资额
     */
    private BigDecimal investment;

    /**
     * 投资比例
     */
    private BigDecimal investmentRatio;

    /**
     * 开启止损
     */
    private Boolean openStopLoss;

    /**
     * 止损比例
     */
    private BigDecimal stopLossRatio;

    /**
     * 跟单状态
     */
    private Integer status;


    @CreatedDate
    @Column(name = "createTime",updatable = false,nullable = false)
    private Date createTime;

    @LastModifiedDate
    @Column(name = "updateTime",nullable = false)
    private Date updateTime;

    @Type(type = "org.hibernate.type.NumericBooleanType")
    private Boolean isDel = false;



}
